package com.tarena.lbs.business.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.business.pojo.po.BusinessPO;
import com.tarena.lbs.business.pojo.po.StorePO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.data.repository.query.Param;

import java.util.List;


@Mapper
public interface BusinessMapper extends BaseMapper<BusinessPO> {
    @Select("SELECT COUNT(*) FROM lbs_business WHERE business_name = #{businessName}")
    int countByBusinessName(@Param("businessName") String businessName);
    @Select("SELECT * FROM lbs_store WHERE business_id = #{businessId}")
    List<StorePO> getStoreListByBusinessId(@Param("businessId") Integer businessId);
}
